
(function () {
    'use strict';

    angular.module('app.citas')
        .service('citasService', ['restBaseUrl', '$http', citasService]);

    function citasService (restBaseUrl, $http) {
        var serviceName = 'CitasService.svc/';

        this.listar = function () {
            var req = {
                method: 'GET',
                url: restBaseUrl + serviceName + 'Listar'
            };

            return $http(req);
        };

        this.listarTiposCitas = function(){
            var tmp_serviceName = 'TipoCitaService.svc/'
            var req = {
                method: 'GET',
                url: restBaseUrl + tmp_serviceName + 'Listar'
            };

            return $http(req);
        }

        this.registrar = function(data){
            var req = {
                method: 'POST',
                url: restBaseUrl + serviceName + 'Create',
                headers: {
                    "Content-Type": "text/plain"
                },
                data : data
            };

            return $http(req);
        };

        this.listarFuncionarios = function(){
            var tmp_serviceName = 'UsuarioService.svc/'
            var req = {
                method: 'GET',
                url: restBaseUrl + tmp_serviceName + 'ListarFuncionarios'
            };

            return $http(req);
        }
    }

})();